package com.mall;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@EnableTransactionManagement//开启注解支持
@EnableScheduling//开启定时任务
@SpringBootApplication(exclude = {SecurityAutoConfiguration.class })
public class XymallApiApplication {
    public static void main(String[] args) {
        SpringApplication.run(XymallApiApplication.class, args);
    }

    @Bean("snokeflake")
    public Snowflake snowflake() {
        return IdUtil.getSnowflake(1,1);
    }

}
